Skip to content

解绑 - UnBind

函数简介

解绑当前已授权设备上的授权信息。调用后由服务端按当前设备上下文执行解绑逻辑。

换机场景:若新设备尚无授权,请使用 强制解绑 - ForceUnBind(须软件发布者开启「开放客户端解绑」)。

返回数据格式:

json
{
  "Code": 1,
  "ServerTime": "2026-04-24 10:00:00.000",
  "Message": "",
  "LicenceKeys": ["xxxx-xxxx-xxxx"]
}
字段名说明
Code结果状态码:1 成功,0 失败。
ServerTime服务器时间。
Message提示信息;失败时多为 错误码:中文描述(如 "2003:参数无效")。完整对照见 客户端错误码说明
LicenceKeys本次返回的激活码列表(可能为空)。

常见错误码(Message 字段)

Message含义
2003:参数无效参数无效
2004:用户不存在用户不存在
2005:软件不可用或未开通软件不可用或未开通
2015:未找到可解绑设备授权当前用户名下无对应设备授权
2016:试用授权不支持解绑试用授权禁止解绑
2017:激活码不属于当前用户设备指定激活码归属校验失败
2099:…解绑业务失败
2099:未知错误未知错误

接口名称

UnBind

DLL调用

long UnBind(string userCode, string softCode, string softVersion, string dealerCode);

参数说明

参数名类型说明
userCode字符串用户码。
softCode字符串软件码。
softVersion字符串软件版本。
dealerCode字符串经销商码。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功
csharp
using OLAPlug;

var ola = new OLAPlugServer();
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
json_result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")
# Python SDK 返回 JSON 字符串,需自行解析
java
import com.olaplug.OLAPlugServer;
import com.olaplug.model.OlaAuthUnbindReturn;

OLAPlugServer ola = new OLAPlugServer();
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功
go
import "github.com/ola/olaplug/olaplug"

ola, _ := olaplug.NewOLAPlugServer("OLAPlug_x64.dll")
defer ola.ReleaseObj()
result := ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")
// result.Code == 1 表示解绑成功
rust
use olaplug::OLAPlugServer;

let ola = OLAPlugServer::new("OLAPlug_x64.dll").unwrap();
let result = ola.un_bind("userCode", "softCode", "1.0.0", "dealerCode");
// result.code == 1 表示解绑成功
cpp
var ola = com("OlaPlug.OlaSoft")
var result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
Set result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")
text
.局部变量 ola, OLAPlug
.局部变量 result, OlaAuthUnbindReturn
ola.创建 ()
result = ola.UnBind(“userCode”, “softCode”, “1.0.0”, “dealerCode”)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var json = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// Aardio SDK 返回 JSON 字符串,需自行解析
text
变量 ola <类型 = OLAPlugServer>
变量 result <类型 = OlaAuthUnbindReturn>
ola = 新建 OLAPlugServer
result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功

原生 DLL 调用

cpp
UnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode");
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long UnBind(string userCode, string softCode, string softVersion, string dealerCode);

UnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode");
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.UnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode")

返回值

调用方式返回值说明
SDKOlaAuthUnbindReturn结构化返回对象;Code == 1 表示解绑成功
原生 DLL非 0成功,返回 JSON 字符串格式的结果。
原生 DLL0失败。

注意事项

项目说明
释放内存返回的字符串指针需要调用 FreeStringPtr 接口释放内存。
返回的激活码可以用于二次授权返回的激活码可以用于二次授权。
错误码Code == 0 时根据 Message 处理;完整码表见 客户端错误码说明。换机场景见 ForceUnBind